//-------------------------------------------------------------------------
//   Copyright 2002-2022 National Technology & Engineering Solutions of
//   Sandia, LLC (NTESS).  Under the terms of Contract DE-NA0003525 with
//   NTESS, the U.S. Government retains certain rights in this software.
//
//   This file is part of the Xyce(TM) Parallel Electrical Simulator.
//
//   Xyce(TM) is free software: you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation, either version 3 of the License, or
//   (at your option) any later version.
//
//   Xyce(TM) is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with Xyce(TM).
//   If not, see <http://www.gnu.org/licenses/>.
//-------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//
// Purpose        : Used to store internal state info for devices
//                  To be used for restarts and migrations
// Special Notes  :
//
// Creator        : Robert Hoekstra, SNL, Parallel Computational Sciences
//
// Creation Date  : 09/02/01
//
//
//
//
//-----------------------------------------------------------------------------

#ifndef Xyce_N_DEV_DeviceState_h
#define Xyce_N_DEV_DeviceState_h

#include <string>
#include <vector>
#include <iosfwd>

#include <N_DEV_fwd.h>

#include <N_UTL_Pack.h>

namespace Xyce {
namespace Device {

//-----------------------------------------------------------------------------
// Class         : DeviceState
// Purpose       :
// Special Notes :
// Creator       : Robert Hoektra, SNL, Parallel Computational Sciences
// Creation Date : 09/02/01
//-----------------------------------------------------------------------------
class DeviceState
{
  friend class Pack<DeviceState>;
  friend std::ostream& operator<<(std::ostream& os, const DeviceState & ds );

public:
  DeviceState( const std::string & id = "" )
    : ID(id)
  {}

  virtual ~DeviceState()
  {}

  //autogenerated copy and assignment for now

  bool operator==(const DeviceState & right) const
  { return ID == right.ID; }
  bool operator!=(const DeviceState & right) const
  { return ID != right.ID; }

  void dump( std::ostream & os );
  void restore( std::istream & is );

  std::string ID;
  std::vector<double> data;
  std::vector<int> dataInt;
};

} // namespace Device
} // namespace Xyce

#endif
